package com.ruoyi.exam.enums;

/**
 * 考试排行榜排序值
 */
public enum ExamRankingSortValEnum {
    SCORES("scores"),
    HAND_ON_SCORE("hands_on_score"),
    THEORY_SCORE("theory_score"),
    SCORES_RANKING("scores_ranking"),
    HAND_ON_SCORE_RANKING("hands_on_score_ranking"),
    THEORY_SCORE_RANKING("theory_score_ranking"),

    MULTIPLE_TIME("multiple_time"),
    HAND_ON_TIME("hands_on_time"),
    THEORY_TIME("theory_time"),
    MULTIPLE_TIME_RANKING("multiple_time_ranking"),
    HAND_ON_TIME_RANKING("hands_on_time_ranking"),
    THEORY_TIME_RANKING("theory_time_ranking"),
    ;
    private String sortVal;

    ExamRankingSortValEnum(String sortVal) {
        this.sortVal = sortVal;
    }

    public String getSortVal() {
        return sortVal;
    }

    public static ExamRankingSortValEnum parse(String sortVal){
        for(ExamRankingSortValEnum sortValEnum : ExamRankingSortValEnum.values()){
            if(sortValEnum.getSortVal().equals(sortVal)){
                return sortValEnum;
            }
        }
        throw new IllegalArgumentException("exam ranking sort val undefined["+ sortVal +"]");
    }
}
